package com.yunxi.service.localService.impl.market;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yunxi.core.service.ServiceImplPlus;
import com.yunxi.dao.market.MarketActivityMapper;
import com.yunxi.market.pojo.*;
import com.yunxi.model.market.MarketActivity;
import com.yunxi.service.localService.market.MarketActivityService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 市场活动主表 服务实现类
 * </p>
 *
 * @author 
 * @since 2019-08-17
 */
@Service
public class MarketActivityServiceImpl extends ServiceImplPlus<MarketActivityMapper, MarketActivity> implements MarketActivityService {

    @Override
    public PageInfo<MarketActivityQueryRespVO> queryMarketActivityForApprovePage(MarketActivityQueryReqVO vo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<MarketActivityQueryRespVO> result = this.baseMapper.queryMarketActivityForApprovePage(vo);
        PageInfo<MarketActivityQueryRespVO> pageInfo = new PageInfo<>(result);
        return pageInfo;
    }

    @Override
    public PageInfo<MarketActivityQueryRespVO> queryMarketActivityForPage(MarketActivityQueryReqVO vo, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<MarketActivityQueryRespVO> result = this.baseMapper.queryMarketActivityForPage(vo);
        PageInfo<MarketActivityQueryRespVO> pageInfo = new PageInfo<>(result);
        return pageInfo;
    }

    @Override
    public String queryPartnerNameByCodes(String partnerCode) {
        return baseMapper.queryPartnerNameByCodes(partnerCode);
    }
}
